package com.aabte.springcloudlearn.eurekaserverproviderdemo.controller;

import com.aabte.springcloudlearn.serviceinterfaces.HelloService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Daniel
 */
@Slf4j
@RestController
public class HelloProviderController implements HelloService {

    @GetMapping("/hello")
    public String hello() {
        log.info("Start hello.");
        return "hello";
    }

    @Override
    public String hello(@PathVariable String name) {
        log.info("Start hello. name: {}", name);
        return "hello " + name;
    }

}
